package com.example.demo.Dao;

import com.example.demo.bean.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserDao {
    //  此处方法名需要与mapper的id对应
    @Select("select * from user where username = #{username} and password = #{password}")
    User selectsUser(String username, String password);
    @Update("update user set password = #{password},role = #{role} where username = #{username}")
    int Updateuser(String username, String password,int role );
    @Select("select * from user")
    List<User> selectUser();
    @Delete("delete from user where username = #{username}")
    int Deleteuser(String  username);
    @Insert("insert into user(username,password) VALUES(#{username},#{password})")
    void InsertUser(String username, String password);
}
